package com.training.file;

import java.io.File;

public class FileDemo05 {
	public static void main(String[] args) throws Exception {
		File file = new File("C:\\");
		File[] fs = file.listFiles();
		for (File f : fs) {
			System.out.println(f.getName());
		}
		find(file);

	}

	public static void find(File file) {
		if (file != null && file.isFile()) {
			System.out.println(file.getName());
			return;
		}
		File[] fs = file.listFiles();
		if (fs != null) {
			for (File f : fs) {
				find(f);
			}
		}
	}

}
